package com.itlong.cloud.equip.app;

import com.itlong.cloud.POJO.DTO.app.AppGetVisitPassWordDTO;
import com.itlong.cloud.POJO.DTO.app.AppGetVisitorRecordPageDTO;
import com.itlong.cloud.POJO.DTO.app.MiniGetReservationProofPageDTO;
import com.itlong.cloud.POJO.PO.AppVisitorPassCodeRecordPO;
import com.itlong.cloud.POJO.VO.app.AppGetVisitorRecordPageVO;
import com.itlong.cloud.POJO.VO.app.MiniGetReservationProofPageVO;
import com.itlong.cloud.POJO.VO.app.MiniGetVisitorPassRecordPageVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      APP访客密码通行记录业务处理暴露接口
 * </desc>
 *
 * @createDate 2017/10/30
 */
@FeignClient(name = "equip-service")
public interface IAppVisitorPassCodeRecordServiceClient {

    /**
     * <desc>
     *      保存访客密码通行记录
     * </desc>
     *
     * @param appGetVisitPassWordDTO 密码通行记录实体类
     * @return sql执行行数
     * @author Jiaqi.X
     * @createDate 2017/10/30
     */
    @RequestMapping(path = "/app/visitor/save",method = RequestMethod.POST)
    public AppVisitorPassCodeRecordPO save(@RequestBody AppGetVisitPassWordDTO appGetVisitPassWordDTO) throws Exception;

    /**
     * <desc>
     *      保存访客人脸信息
     * </desc>
     *
     * @param passId 访客信息编号
     * @param uploadFilePath 图片地址
     * @param vFaceId 百度中的人脸编号
     * @param projectId 项目编号
     * @param idcardKey 身份证序号
     * @param idcardKey 访客预约标识
     * @return sql执行行数
     * @author Qiang.S
     * @createDate 2019/02/27
     */
    @RequestMapping(path = "/app/visitor/setVisitPassFace",method = RequestMethod.POST)
    Integer setVisitPassFace(@RequestParam("passId")String passId, @RequestParam("uploadFilePath")String uploadFilePath,
                             @RequestParam("vFaceId")String vFaceId, @RequestParam("projectId")String projectId,
                             @RequestParam("idcardKey")String idcardKey, @RequestParam("visitorReservationMark")Integer visitorReservationMark) throws Exception;

    /**
     * <desc>
     *      获取分页数据
     * </desc>
     *
     * @param pageDTO   参数DTO
     * @return
     * @author Jiaqi.X
     * @createDate 2017/10/31
     */
    @RequestMapping(path = "/app/visitor/getVisitorRecord",method = RequestMethod.POST)
    Page<AppGetVisitorRecordPageVO> getPage(@RequestBody AppGetVisitorRecordPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      设置已分享
     * </desc>
     *
     * @param passId   访客唯一编号
     * @return
     * @author Qiang.S
     * @createDate 2019/04/16
     */
    @RequestMapping(path = "/app/visitor/setShare",method = RequestMethod.POST)
    void setShare(@RequestParam("passId")String passId) throws Exception;

    /**
     * <desc>
     *      根据楼栋,单元,房间查询地址
     * </desc>
     *
     * @param buildId   楼栋编号
     * @param unitId   单元编号
     * @param roomId   房间编号
     * @return
     * @author Qiang.S
     * @createDate 2019/04/16
     */
    @RequestMapping(path = "/app/visitor/getAddress",method = RequestMethod.POST)
    String getAddress(@RequestParam("buildId")String buildId, @RequestParam("unitId")String unitId, @RequestParam("roomId")String roomId) throws Exception;

    /**
     * <desc>
     *      根据访客编号获取信息
     * </desc>
     *
     * @param passId 访客编号
     * @return 格式化响应结果
     * @author Qiang.S
     * @createDate 2019/04/24
     */
    @RequestMapping(path = "/app/visitor/getVisitorPassByPassId",method = RequestMethod.POST)
    AppGetVisitorRecordPageVO getVisitorPassByPassId(@RequestParam("passId")String passId) throws Exception;

    /**
     * <desc>
     *      删除访客信息
     * </desc>
     *
     * @param passId 访客编号
     * @return 格式化响应结果
     * @author Qiang.S
     * @createDate 2019/04/28
     */
    @RequestMapping(path = "/app/visitor/deleteVisitorInfo",method = RequestMethod.POST)
    Integer deleteVisitorInfo(@RequestParam("passId")String passId) throws Exception;

    /**
     * <desc>
     *      获取访客预约凭证分页数据
     * </desc>
     *
     * @param pageDTO   参数DTO
     * @return
     * @author Juguang.S
     * @createDate 2019/04/29
     */
    @RequestMapping(path = "/app/visitor/getReservationProofPage",method = RequestMethod.POST)
    Page<MiniGetReservationProofPageVO> getReservationProofPage(@RequestBody MiniGetReservationProofPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      获取访客身份通行记录
     * </desc>
     *
     * @param pageDTO   参数DTO
     * @return
     * @author Juguang.S
     * @createDate 2019/04/30
     */
    @RequestMapping(path = "/app/visitor/getVisitorPassRecordPage",method = RequestMethod.POST)
    Page<MiniGetVisitorPassRecordPageVO> getVisitorPassRecordPage(@RequestBody MiniGetReservationProofPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      获取访客单信息
     * </desc>
     *
     * @param userId   用户编号
     * @param projectId   项目编号
     * @return
     * @author Qiang.S
     * @createDate 2019/05/05
     */
    @RequestMapping(path = "/app/visitor/getReservationVisitorInfo",method = RequestMethod.POST)
    List<MiniGetReservationProofPageVO> getReservationVisitorInfo(@RequestParam("userId")String userId, @RequestParam("projectId")String projectId) throws Exception;

    /**
     * <desc>
     *      获取当前用户注册人脸信息
     * </desc>
     *
     * @param userId   用户编号
     * @param projectId   项目编号
     * @param type   当前用户身份类型 1代表业主 2代表访客
     * @return 人脸url
     * @author Juguang.S
     * @createDate 2019/05/06
     */
    @RequestMapping(path = "/app/visitor/getUserFaceUrlInfo",method = RequestMethod.POST)
    Map<String,String> getUserFaceUrlInfo(@RequestParam("userId")String userId, @RequestParam("projectId")String projectId, @RequestParam("type")String type);

    /**
     * <desc>
     *      校验该访客记录是否已被物业审批并且已认证过
     * </desc>
     *
     * @param passId  访客单号
     * @return
     * @author Juguang.S
     * @createDate 2019/05/27
     */
    @RequestMapping(path = "/app/visitor/isAllowedAuthenticate",method = RequestMethod.POST)
    Integer isAllowedAuthenticate(@RequestParam("passId")String passId);

    /**
     * <desc>
     *      获取有效的访客通行密码记录
     * </desc>
     *
     * @param projectId 项目编号
     * @param pageNo 页数
     * @param pageSize 每页数
     * @param userId 用户id
     * @return 有效的访客通行密码记录
     * @author wangzhi
     * @createDate 2019/07/11
     */
    @RequestMapping(path = "/app/visitor/getAvailableVisitorPwd",method = RequestMethod.POST)
    Map<String,Object> getAvailableVisitorPwd(@RequestParam("projectId") String projectId, @RequestParam("pageNo") String pageNo,
                                              @RequestParam("pageSize") String pageSize, @RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      物业业主审核通过有效时间变更后重新处理生成二维码相关逻辑
     * </desc>
     *
     * @param appGetVisitPassWordDTO 访客密码通行记录实体类
     * @return
     * @author Juguang.S
     * @createDate 2020/09/16
     */
    @RequestMapping(path = "/app/visitor/updateQrcodeByTimeModify",method = RequestMethod.POST)
    AppVisitorPassCodeRecordPO updateQrcodeByTimeModify(@RequestBody AppGetVisitPassWordDTO appGetVisitPassWordDTO) throws Exception;

}
